package com.qf.j2102.service.impl;


import com.qf.j2102.mapper.SysCityMapper;
import com.qf.j2102.po.SysCity;
import com.qf.j2102.service.SysCityService;
import com.qf.j2102.vo.VCity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysCityServiceImpl implements SysCityService {

    @Autowired
    private SysCityMapper cityDao;

    @Override
    public List<SysCity> selectAll(Integer pid) {
        List<SysCity> list = cityDao.selectByPid(pid);
        return list;
    }

    @Override
    public List<SysCity> selectAllInfo() {

        List<SysCity> list = cityDao.selectAll();
        return list;
    }

    @Override
    public VCity selectCitys(Integer getid, Integer backid) {

        SysCity getCity = cityDao.selectByPrimaryKey(getid);
        SysCity backCity = cityDao.selectByPrimaryKey(backid);

        VCity city = new VCity();
        city.setGetCity(getCity);
        city.setBackCity(backCity);

        return city;
    }
}
